package com.storm.datasource.util

import com.baomidou.mybatisplus.extension.kotlin.KtQueryWrapper

/**
 * 得到条件拼接器并进行条件拼接
 */
inline fun <reified T : Any> queryWrapper(block: KtQueryWrapper<T>.() -> KtQueryWrapper<T>): KtQueryWrapper<T> {
    return getKtQueryWrapper<T>()
            .run(block)
}
/**
 * 得到条件拼接器
 */
inline fun <reified T : Any> getKtQueryWrapper(): KtQueryWrapper<T> {
    return KtQueryWrapper(T::class.java)
}